<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>添加商品</title>
    <css file="__STATIC__/hdjs/hdui.css"/>
    <css file="__STATIC__/bootstrap/css/bootstrap.min.css"/>
    <style type="text/css">
		.checkbox{
			 margin-left:5px;    
			 width:90px;
			 margin-top: 10px;
		}
		textarea{
			width: 300px;
			height: 100px;
            float: left;
		}
    </style>
	<script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor1_4_3/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor1_4_3/ueditor.all.min.js"> </script>
	<script type="text/javascript" charset="utf-8" src="__STATIC__/ueditor1_4_3/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" src="__STATIC__/jquery/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <link href="__STATIC__/uploadify/uploadify.css" type="text/css" rel="stylesheet"></link>
</head>
<body>
	
<script>
	var ue = UE.getEditor('editor');
</script>
<div class="wrap">
    <div class="title-header">添加商品</div>
    <form action="" method="post" class="form-inline hd-form" enctype="multipart/form-data">
        <table class="table1">
            <tr>
                <th class="w100">商品名称</th>
                <td class="w100">
                    <input type="text" name="coname" class="w200"/> 
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">价格</th>
                <td>
                    <input type="text" name="copice" class="w200" value=""/>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">所属分类</th>
                <td>
                    <select name="ll_category_cid" class="w200">
                    	<option value="0">请选择分类</option>
                    	<foreach from="$cateData" value="$v" key="$k">
                    		<option value="{$v.cid}">{$v._name}</option>
                    	</foreach>
                    	
                    </select>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">商品原料</th>
                <td>
                	<textarea name="coraw" rows="" cols=""></textarea>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">图片上传</th>
                <td>
                    <input id="file" type="file" multiple="true">
                    <div lab="uploadFile">
                        <input type="hidden" name="picc[]" />
                        <span>类型: *.jpg,*.png 大小: 2000KB 数量: 10</span>
                            <div id="uploadList">
                              <ul>
               
                              </ul>
                            </div>
                        
                    </div>
                    <div id="photo_list">
                    </div>
                </td>
            </tr>
            <tr>
                <th class="w100">商品重量</th>
                <td>
                    <label class="checkbox-inline">
                        
                        <input type="checkbox" value="1.2磅" name="coweight[]" class="check_input">1.2磅
                    </label>
                    <label class="checkbox-inline">
                        
                        <input type="checkbox" value="2.2磅" name="coweight[]" class="check_input">2.2磅
                    </label>
                    <label class="checkbox-inline">
                        
                        <input type="checkbox" value="6.0磅" name="coweight[]" class="check_input">6.0磅
                    </label>
                </td>
                <td></td>
            </tr>
            <tr >
                <th class="w100">商品甜度</th>
                <td style="width:900px">
                    <label class="checkbox-inline">
                        
                        <input type="radio" value="1颗星" name="cosweet" class="check_input">1颗星
                    </label>
                    <label class="checkbox-inline">
                        
                        <input type="radio" value="2颗星" name="cosweet" class="check_input">2颗星
                    </label>
                    <label class="checkbox-inline">
                        
                        <input type="radio" value="3颗星" name="cosweet" class="check_input">3颗星
                    </label>
                    <label class="checkbox-inline">
                        
                        <input type="radio" value="4颗星" name="cosweet" class="check_input">4颗星
                    </label>
                    <label class="checkbox-inline">
                        
                        <input type="radio" value="5颗星" name="cosweet" class="check_input">5颗星
                    </label>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100" >商品描述</th>
                <td >
                    <textarea name="codes" id="" cols="30" rows="10"></textarea>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100" >商品注意事项</th>
                <td >
                    <textarea name="coatt" id="" cols="30" rows="10"></textarea>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">详细内容</th>
                <td colspan="2">
                    <script id="editor" type="text/plain" style="width:100%;height:300px;padding-bottom:20px"></script>
                </td>
            </tr>
            <tr>
                <th class="w100"></th>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <th class="w100"></th>
                <td></td>
                <td></td>
            </tr>
        
        </table>
        <div class="position-bottom">
            <input type="submit" class="hd-success" value="添加"/>
        </div>
    </form>

    <script type="text/javascript">
                    $(function() {
                        $('#file').uploadify({
                          'formData'     : {//POST数据
                              '<?php echo session_name();?>' : '<?php echo session_id();?>',
                          },
                          'fileTypeDesc' : '上传文件',//上传描述
                          'fileTypeExts' : '',
                          'swf'      : '__STATIC__/uploadify/uploadify.swf',
                          'uploader' : '{|U:"Commodity/upload"}',
                          'buttonText':'选择文件',
                          'fileSizeLimit' : '2000KB',
                          'uploadLimit' : 1000,//上传文件数
                          'width':65,
                          'height':25,
                          'successTimeout':10,//等待服务器响应时间
                          'removeTimeout' : 0.2,//成功显示时间,
                          'onUploadSuccess' : function(file, data, response) {
                              data=$.parseJSON(data);
                              // var imageUrl = data.image?data.url:'__STATIC__/image/default.png';
                              var li="<li path='"+data.url+"' url='"+data.url+"'><img src='"+data.url+"' style='width:70px;height:70px;float:left;margin-right:30px;' class='hd-w80 hd-h70'/><input type='hidden' name='opic[]' value='"+data.opic+"'><input type='hidden' name='spic[]' value='"+data.spic+"'><input type='hidden' name='cpic[]' value='"+data.cpic+"'><input type='hidden' name='bpic[]' value='"+data.bpic+"'></li>";
                              $("#uploadList ul").prepend(li);
                          } 
                        });
                    });
                    </script>
</div>
</body>
</html>
